import request from '@/utils/request'

// 创建订单接口
export const createOrderAPI = (data) => {
  console.log(data)

  return request({
    url: '/ios/order',
    method: 'POST',
    data
  })
}
// 获取订单详情页
export const getOrderAPI = (orderNumber) => {
  return request({
    url: `/ios/order/${orderNumber}`
  })
}
// 取消订单
export const cancelOrderAPI = (data) => {
  return request({
    url: `/ios/order`,
    method: 'PUT',
    data
  })
}
// 我的订单获取
export const getUserOrderAPI = (params) => {
  return request({
    url: '/ios/order/list',
    method: 'GET',
    params
  })
}

// 获取购物车逻辑添加的订单列表
export const getCartToOrdersAPI = (userId) => {
  return request({
    url: '/ios/ShoppingCartDetails/getToOrderDetails',
    params: { userId }
  })
}
